home *** CD-ROM | disk | FTP | other *** search
/ Workbench Add-On / Workbench Add-On - Volume 1.iso / Dev / Lisp / 68000 / impnotes.txt < prev    next >
Text File  |  1995-08-25  |  44KB  |  1,310 lines

  1.                 Implementation Notes for CLISP
  2.                 ==============================
  3.                 Last modified: 30 March 1993.
  4.  
  5. This implementation is mostly compatible to the standard reference
  6.  
  7.        Guy L. Steele Jr.: Common Lisp - The Language (1st ed.).
  8.        Digital Press 1984.
  9.        (CLtL1 for short)
  10.  
  11.  
  12. These notes document the differences of the CLISP implementation of Common
  13. Lisp to the standard CLtL1, and some implementation details.
  14.  
  15.  
  16.                       CHAPTER 1: Introduction
  17.                       -----------------------
  18.  
  19. No notes.
  20.  
  21.  
  22.                        CHAPTER 2: Data Types
  23.                        ---------------------
  24.  
  25. All the data types are implemented: numbers, characters, symbols, lists,
  26. arrays, hash tables, readtables, packages, pathnames, streams, random
  27. states, structures and functions.
  28.  
  29. 2.1.3.
  30. ------
  31.  
  32. There are four floating point types: short-float, single-float, double-float
  33. and long-float:
  34.                   sign    mantissa   exponent
  35.    short-float    1 bit   16+1 bits   8 bits
  36.    single-float   1 bit   23+1 bits   8 bits   CLISP uses IEEE format
  37.    double-float   1 bit   52+1 bits  11 bits   CLISP uses IEEE format
  38.    long-float     1 bit   >=64 bits  32 bits
  39.  
  40. The single and double float formats are those of the IEEE standard (1981),
  41. except that CLISP does not support features like +0, -0, +inf, -inf, gradual
  42. underflow, NaN, etc. (Common Lisp does not make use of these features.)
  43.  
  44. Long floats have variable mantissa length, which is a multiple of 16 (or 32,
  45. depending on the word size of the processor). The default length used when
  46. long floats are read is given by the place (LONG-FLOAT-DIGITS). It can be
  47. set by (SETF (LONG-FLOAT-DIGITS) nnn), where nnn is a positive integer.
  48.  
  49. 2.1.4.
  50. ------
  51.  
  52. Complex numbers can have a real part and an imaginary part of different
  53. types. For example, (SQRT -9.0) evaluates to the number #C(0 3.0), which has
  54. a real part of exactly 0, not only 0.0 (which would mean "approximately 0").
  55. The type specifier for this is (COMPLEX INTEGER SINGLE-FLOAT), and
  56.  
  57.            (COMPLEX type-of-real-part type-of-imaginary-part)
  58.  
  59. in general.
  60. The type specifier (COMPLEX type) is equivalent to (COMPLEX type type).
  61.  
  62. 2.2.1.
  63. ------
  64.  
  65. The characters are ordered according to the ASCII encoding.
  66.  
  67. More precisely, CLISP uses the ISO Latin-1 (ISO 8859-1) character set:
  68.              $0 $1 $2 $3 $4 $5 $6 $7 $8 $9 $A $B $C $D $E $F
  69.          $00 ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** **
  70.          $10 ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** **
  71.          $20     !  "  #  $  %  &  '  (  )  *  +  ,  -  .  /
  72.          $30  0  1  2  3  4  5  6  7  8  9  :  ;  <  =  >  ?
  73.          $40  @  A  B  C  D  E  F  G  H  I  J  K  L  M  N  O
  74.          $50  P  Q  R  S  T  U  V  W  X  Y  Z  [  \  ]  ^  _
  75.          $60  `  a  b  c  d  e  f  g  h  i  j  k  l  m  n  o
  76.          $70  p  q  r  s  t  u  v  w  x  y  z  {  |  }  ~   
  77.          $80                                                
  78.          $90                                                
  79.          $A0     ¡  ¢  £  ¤  ¥  ¦  §  ¨  ©  ª  «  ¬  ­  ®  ¯
  80.          $B0  °  ±  ²  ³  ´  µ  ¶  ·  ¸  ¹  º  »  ¼  ½  ¾  ¿
  81.          $C0  À  Á  Â  Ã  Ä  Å  Æ  Ç  È  É  Ê  Ë  Ì  Í  Î  Ï
  82.          $D0  Ð  Ñ  Ò  Ó  Ô  Õ  Ö  ×  Ø  Ù  Ú  Û  Ü  Ý  Þ  ß
  83.          $E0  à  á  â  ã  ä  å  æ  ç  è  é  ê  ë  ì  í  î  ï
  84.          $F0  ð  ñ  ò  ó  ô  õ  ö  ÷  ø  ù  ú  û  ü  ý  þ  ÿ
  85. Here ** are control characters, not graphic characters. (The characters left
  86. blank here cannot be represented in this character set).
  87.  
  88. The following are standard characters:
  89.   #\Space               $20
  90.   #\Newline             $0A
  91. The following are semi-standard characters:
  92.   #\Backspace           $08
  93.   #\Tab                 $09
  94.   #\Linefeed            $0A
  95.   #\Page                $0C
  96.   #\Return              $0D
  97.   #\Rubout              $08
  98.  
  99. 2.2.2.
  100. ------
  101.  
  102. #\Newline is the delimiter between lines.
  103.  
  104. When reading from a file, CR/LF is converted to #\Newline, and CR not
  105. followed by LF is read as #\Return.
  106.  
  107. 2.2.3.
  108. ------
  109.  
  110. There are the following additional characters with names:
  111.   #\Null                $00
  112.   #\Bell                $07
  113.   #\Escape              $1B
  114.  
  115. 2.2.4.
  116. ------
  117.  
  118. The code of a character is >=0, <256. CHAR-CODE-LIMIT = 256.
  119.  
  120. There are fonts 0 to 15, and CHAR-FONT-LIMIT = 16. But the system itself
  121. uses only font 0.
  122.  
  123. The following bits attributes are implemented: :CONTROL, :META, :SUPER,
  124. :HYPER. Therefore CHAR-BITS-LIMIT = 16.
  125.  
  126. 2.5.
  127. ----
  128.  
  129. The maximum rank (number of dimensions) of an array is 65535 on 16-bit
  130. processors, 4294967295 on 32-bit processors.
  131.  
  132. 2.13.
  133. -----
  134.  
  135. All the functions built by FUNCTION, COMPILE and the like are atoms. There
  136. are built-in functions written in C, compiled functions (both of type
  137. COMPILED-FUNCTION) and interpreted functions (of type FUNCTION).
  138. The possible function names (CLtL1 p. 59) are symbols and lambda expressions.
  139.  
  140. 2.14.
  141. -----
  142.  
  143. This is the list of objects whose external representation can not be
  144. meaningfully read in:
  145.   * all structures lacking a keyword constructor.
  146.   * all arrays except strings, if *PRINT-ARRAY* = NIL.
  147.   * #<SYSTEM-FUNCTION name>     built-in function written in C
  148.   * #<SPECIAL-FORM name>        special form handler
  149.   * #<COMPILED-CLOSURE name>    compiled function, if *PRINT-CLOSURE* = NIL
  150.   * #<CLOSURE name ...>         interpreted function
  151.   * #<FRAME-POINTER #x...>      pointer to a stack frame
  152.   * #<DISABLED POINTER>         frame pointer which has become invalid on
  153.                                 exit from the corresponding BLOCK or TAGBODY
  154.   * #<...-STREAM ...>           stream
  155.   * #<PACKAGE name>             package
  156.   * #<HASH-TABLE #x...>         hash table, if *PRINT-ARRAY* = NIL
  157.   * #<READTABLE #x...>          readtable
  158.   * #<UNBOUND>                  "value" of a symbol without value, "value"
  159.                                 of an unsupplied optional or keyword argument
  160.   * #<SPECIAL REFERENCE>        environment marker for variables declared
  161.                                 SPECIAL
  162.   * #<DOT>                      internal READ result for "."
  163.   * #<END OF FILE>              internal READ result, when the end of file
  164.                                 is reached
  165.   * #<READ-LABEL ...>           intermediate READ result for #n#
  166.   * #<ADDRESS #x...>            machine address, should not occur
  167.   * #<SYSTEM-POINTER #x...>     should not occur
  168.  
  169. 2.15.
  170. -----
  171.  
  172. The type NUMBER is the disjoint union of the types REAL and COMPLEX. (CLtL
  173. wording: "exhaustive partition")
  174. The type REAL is the disjoint union of the types RATIONAL and FLOAT.
  175. The type RATIONAL is the disjoint union of the types INTEGER and RATIO.
  176. The type INTEGER is the disjoint union of the types FIXNUM and BIGNUM.
  177. The type FLOAT is the disjoint union of the types SHORT-FLOAT, SINGLE-FLOAT,
  178. DOUBLE-FLOAT and LONG-FLOAT.
  179.  
  180.  
  181.                      CHAPTER 3: Scope and Extent
  182.                      ---------------------------
  183.  
  184. is implemented as described.
  185.  
  186.  
  187.                       CHAPTER 4: Type Specifiers
  188.                       --------------------------
  189.  
  190. 4.5.
  191. ----
  192.  
  193. The general form of the COMPLEX type specifier is
  194. (COMPLEX type-of-real-part type-of-imaginary-part).
  195. The type specifier (COMPLEX type) is equivalent to (COMPLEX type type).
  196.  
  197. 4.6.
  198. ----
  199.  
  200. The REAL type specifier (REAL low high) denotes the real numbers between low
  201. and high.
  202.  
  203. 4.7.
  204. ----
  205.  
  206. DEFTYPE lambda lists are subject to destructuring (nested lambda lists are
  207. allowed, as in DEFMACRO) and may contain a &WHOLE marker, but no
  208. &ENVIRONMENT marker.
  209.  
  210. 4.9.
  211. ----
  212.  
  213. The possible results of TYPE-OF are:
  214.  CONS
  215.  SYMBOL NULL
  216.  FIXNUM BIGNUM RATIO SHORT-FLOAT SINGLE-FLOAT DOUBLE-FLOAT LONG-FLOAT COMPLEX
  217.  CHARACTER
  218.  (ARRAY element-type dimensions), (SIMPLE-ARRAY element-type dimensions)
  219.  (VECTOR T size), (SIMPLE-VECTOR size)
  220.  (STRING size), (SIMPLE-STRING size)
  221.  (BIT-VECTOR size), (SIMPLE-BIT-VECTOR size)
  222.  FUNCTION COMPILED-FUNCTION
  223.  STREAM PACKAGE HASH-TABLE READTABLE PATHNAME RANDOM-STATE
  224.  BYTE LOAD-TIME-EVAL READ-LABEL FRAME-POINTER SYSTEM-INTERNAL
  225.  ADDRESS (should not occur)
  226.  any other symbol (structure types)
  227.  
  228.  
  229.                        CHAPTER 5: Program Structure
  230.                        ----------------------------
  231.  
  232. 5.1.3.
  233. ------
  234.  
  235. In addition to the 24 special forms listed on p. 57, the macros
  236. PSETQ, PROG1, PROG2, WHEN, UNLESS, COND, MULTIPLE-VALUE-LIST,
  237. MULTIPLE-VALUE-BIND, MULTIPLE-VALUE-SETQ, AND, OR
  238. are implemented as special forms.
  239.  
  240. Constants may not be bound dynamically or lexically.
  241.  
  242. 5.2.2.
  243. ------
  244.  
  245. LAMBDA-LIST-KEYWORDS =
  246.     (&OPTIONAL &REST &KEY &ALLOW-OTHER-KEYS &AUX &BODY &WHOLE &ENVIRONMENT)
  247.  
  248. LAMBDA-PARAMETERS-LIMIT is 65536 on 16-bit processors, 4294967296 on 32-bit
  249. processors.
  250.  
  251. 5.3.
  252. ----
  253.  
  254. DEFUN and DEFMACRO are allowed in non-toplevel positions.
  255. As an example, consider the definition of GENSYM:
  256. (let ((gensym-prefix "G")
  257.       (gensym-count 1))
  258.   (defun gensym (&optional (x nil s))
  259.     (when s
  260.       (cond ((stringp x) (setq gensym-prefix x))
  261.             ((integerp x)
  262.              (if (minusp x)
  263.                (error "~S: index ~S is negative" 'gensym x)
  264.                (setq gensym-count x)
  265.             ))
  266.             (t (error "~S: argument ~S of wrong type" 'gensym x))
  267.     ) )
  268.     (prog1
  269.       (make-symbol
  270.         (concatenate 'string
  271.           gensym-prefix
  272.           (write-to-string gensym-count :base 10 :radix nil)
  273.       ) )
  274.       (incf gensym-count)
  275. ) )
  276.  
  277. 5.3.2.
  278. ------
  279.  
  280. (PROCLAIM '(SPECIAL var)) declarations may not be undone. The same holds
  281. for DEFVAR, DEFPARAMETER and DEFCONSTANT declarations.
  282.  
  283. It is an error if a DEFCONSTANT variable is bound at the moment the
  284. DEFCONSTANT is executed, but DEFCONSTANT does not check this.
  285.  
  286. Constants may not be bound dynamically or lexically.
  287.  
  288.  
  289.                       CHAPTER 6: Predicates
  290.                       ---------------------
  291.  
  292. 6.2.2.
  293. ------
  294.  
  295. REALP returns T is its argument is a real number, NIL otherwise.
  296.  
  297. COMPILED-FUNCTION-P returns T on built-in functions written in C, compiled
  298. functions and special form handlers. Therefore COMPILED-FUNCTION is not a
  299. subtype of FUNCTION.
  300.  
  301. 6.3.
  302. ----
  303.  
  304. EQ compares characters and fixnums as EQL does. No unnecessary copies are
  305. made of characters and numbers. Nevertheless, one should use EQL.
  306.  
  307. (let ((x y)) (eq x x)) always returns T, regardless of y.
  308.  
  309. 6.4.
  310. ----
  311.  
  312. AND and OR are implemented as special forms and, as such, rather efficient.
  313.  
  314.  
  315.                       CHAPTER 7: Control Structure
  316.                       ----------------------------
  317.  
  318. 7.1.1.
  319. ------
  320.  
  321. (FUNCTION symbol) returns the local function definition established by FLET
  322. or LABELS, if it exists, otherwise the global function definition.
  323.  
  324. (SPECIAL-FORM-P symbol) returns NIL or T. If it returns T, then
  325. (SYMBOL-FUNCTION symbol) returns the (useless) special form handler.
  326.  
  327. 7.1.2.
  328. ------
  329.  
  330. PSETQ is implemented as a special form and, as such, rather efficient.
  331.  
  332. 7.2.
  333. ----
  334.  
  335. (SETF (SYMBOL-FUNCTION symbol) object) requires object to be either a
  336. function, a SYMBOL-FUNCTION return value or a lambda expression. A lambda
  337. expression is thereby immediately converted to a function.
  338.  
  339. SETF also accepts places yielding multiple values.
  340.  
  341. Additional places:
  342.  
  343. * FUNCALL:
  344.   (SETF (FUNCALL #'symbol ...) object) and
  345.   (SETF (FUNCALL 'symbol ...) object)
  346.   are equivalent to (SETF (symbol ...) object).
  347.  
  348. * GET-DISPATCH-MACRO-CHARACTER:
  349.   (SETF (GET-DISPATCH-MACRO-CHARACTER ...) ...)
  350.   performs a SET-DISPATCH-MACRO-CHARACTER.
  351.  
  352. * LONG-FLOAT-DIGITS:
  353.   (SETF (LONG-FLOAT-DIGITS) digits) sets the default mantissa length of long
  354.   floats to digits bits.
  355.  
  356. * VALUES:
  357.   (SETF (VALUES place1 ... placek) form)
  358.   is approximately equivalent to
  359.      (MULTIPLE-VALUE-BIND (dummy1 ... dummyk) form
  360.        (SETF place1 dummy1 ... placek dummyk)
  361.        (VALUES dummy1 ... dummyk)
  362.      )
  363.   Example:
  364.     (SETF (VALUES A B) (VALUES B A)) interchanges the values of A and B.
  365.  
  366. * VALUES-LIST:
  367.   (SETF (VALUES-LIST list) form)  is equivalent to
  368.   (VALUES-LIST (SETF list (MULTIPLE-VALUE-LIST form)))
  369.  
  370. &KEY markers in DEFSETF lambda lists are supported, but the corresponding
  371. keywords must appear literally in the program text.
  372.  
  373. (GET-SETF-METHOD form &optional env) and
  374. (GET-SETF-METHOD-MULTIPLE-VALUE form &optional env)
  375. receives as optional argument the environment necessary for macro expansions.
  376. In DEFINE-SETF-METHOD lambda lists, one can specify &ENVIRONMENT and a
  377. variable, which will be bound to the environment. This environment should be
  378. passed to all calls of GET-SETF-METHOD and GET-SETF-METHOD-MULTIPLE-VALUE.
  379. If this is done, even local macros will be interpreted as places correctly.
  380.  
  381. 7.3.
  382. ----
  383.  
  384. CALL-ARGUMENTS-LIMIT is 65536 on 16-bit processors, 4294967296 on 32-bit
  385. processors.
  386.  
  387. 7.4.
  388. ----
  389.  
  390. PROG1 and PROG2 are implemented as special forms and, as such, rather
  391. efficient.
  392.  
  393. 7.5.
  394. ----
  395.  
  396. If using the optional package MACROS3:
  397.   The macros LETF and LETF* are like LET and LET*, resp., except that they
  398.   can bind places, even places with multiple values.
  399.   Example:
  400.   (LETF (((VALUES A B) form)) ...)
  401.     is equivalent to
  402.     (MULTIPLE-VALUE-BIND (A B) form ...)
  403.   (LETF (((FIRST L) 7)) ...)
  404.     is approximately equivalent to
  405.     (LET* ((#:G1 L) (#:G2 (FIRST #:G1)))
  406.       (UNWIND-PROTECT (PROGN (SETF (FIRST #:G1) 7) ...)
  407.                       (SETF (FIRST #:G1) #:G2)
  408.     ) )
  409.  
  410. 7.6.
  411. ----
  412.  
  413. WHEN, UNLESS, COND are implemented as special forms and, as such, rather
  414. efficient.
  415.  
  416. 7.8.4.
  417. ------
  418.  
  419. The function MAPCAP is like MAPCAN, except that it concatenates the
  420. resulting lists with APPEND instead of NCONC:
  421.   (MAPCAP fun x1 ... xn) == (apply #'append (mapcar fun x1 ... xn))
  422. (Actually a bit more efficient that this would be.)
  423.  
  424. The function MAPLAP is like MAPCON, except that it concatenates the
  425. resulting lists with APPEND instead of NCONC:
  426.   (MAPLAP fun x1 ... xn) = (apply #'append (maplist fun x1 ... xn))
  427. (Actually a bit more efficient that this would be.)
  428.  
  429. 7.9.1.
  430. ------
  431.  
  432. MULTIPLE-VALUES-LIMIT = 128
  433.  
  434. MULTIPLE-VALUE-LIST, MULTIPLE-VALUE-BIND, MULTIPLE-VALUE-SETQ are
  435. implemented as special forms and, as such, rather efficient.
  436.  
  437. If using the optional package MACROS3:
  438.   The macro NTH-VALUE:
  439.   (NTH-VALUE n form) returns the (n+1)st value (n>=0) of form.
  440.  
  441.  
  442.                         CHAPTER 8: Macros
  443.                         -----------------
  444.  
  445. No notes.
  446.  
  447.  
  448.                      CHAPTER 9: Declarations
  449.                      -----------------------
  450.  
  451. 9.2.
  452. ----
  453.  
  454. The declarations (TYPE type var ...), (FTYPE type fun ...),
  455. (FUNCTION name arglist result-type), (OPTIMIZE (quality value) ...)
  456. are ignored by the interpreter and the compiler.
  457.  
  458. Additional declarations:
  459.  
  460. * The declaration (COMPILE) has the effect that the current form is compiled
  461.   prior to execution.
  462.   Examples:
  463.   (LOCALLY (DECLARE (COMPILE)) form)
  464.   executes a compiled version of form.
  465.   (let ((x 0))
  466.     (flet ((inc () (declare (compile)) (incf x))
  467.            (dec () (decf x)))
  468.       (values #'inc #'dec)
  469.   ) )
  470.   returns two functions. The first is compiled and increments x, the second
  471.   is interpreted (slower) and decrements the same x.
  472.  
  473. 9.3.
  474. ----
  475.  
  476. The type assertion (THE value-type form) enforces a type check in
  477. interpreted code. No type check is done in compiled code.
  478.  
  479. If using the optional package MACROS3:
  480. (ETHE value-type form) enforces a type check in both interpreted and
  481. compiled code.
  482.  
  483.  
  484.                          CHAPTER 10: Symbols
  485.                          -------------------
  486.  
  487. No notes.
  488.  
  489.  
  490.                          CHAPTER 11: Packages
  491.                          --------------------
  492.  
  493. 11.6.
  494. -----
  495.  
  496. The package SYSTEM has the nicknames "SYS" and, additionally, "COMPILER".
  497.  
  498. 11.8.
  499. -----
  500.  
  501. The function REQUIRE receives as optional argument either a pathname or a
  502. list of pathnames: files to be loaded if the required module is not already
  503. in memory.
  504.  
  505.  
  506.                            CHAPTER 12: Numbers
  507.                            -------------------
  508.  
  509. The single and double float formats are those of the IEEE standard (1981),
  510. except that CLISP does not support features like +0, -0, +inf, -inf, gradual
  511. underflow, NaN, etc. (Common Lisp does not make use of these features.)
  512.  
  513. The default number of mantissa bits in long floats is given by the place
  514. (LONG-FLOAT-DIGITS).
  515. Example: (SETF (LONG-FLOAT-DIGITS) 3322) sets the default precision of long
  516. floats to 1000 decimal digits.
  517.  
  518. 12.1.
  519. -----
  520.  
  521. Complex numbers can have a real part and an imaginary part of different
  522. types. If the imaginary part is EQL to 0, the number is automatically
  523. converted to a real number. (Cf. CLtL1 p. 195)
  524. This has the advantage that  (let ((x (sqrt -9.0))) (* x x))
  525. - instead of evaluting to #C(-9.0 0.0), with x = #C(0.0 3.0) -
  526. evaluates to #C(-9.0 0) = -9.0, with x = #C(0 3.0).
  527.  
  528. Coercions on operations involving different types:
  529. The result of an arithmetic operation whose arguments are of different float
  530. types is rounded to the float format of the shortest (least precise) of the
  531. arguments.
  532.     rational -> long float -> double float -> single float -> short float
  533. (in contrast to CLtL1 p. 195!)
  534. Rationale:
  535.   See it mathematically. Add intervals:
  536.   {1.0 +/- 1e-8} + {1.0 +/- 1e-16} = {2.0 +/- 1e-8}
  537.   So, if we add 1.0s0 and 1.0d0, we should get 2.0s0.
  538. Shortly:
  539.   Do not suggest accuracy of a result by giving it a precision that is
  540.   greater than its accuracy.
  541. Example:
  542.   (- (+ 1.7 pi) pi)  should not return  1.700000726342836417234L0,
  543.   it should return 1.7f0 (or 1.700001f0 if there were rounding errors).
  544. Experience:
  545.   If in a computation using thousands of short floats, a long float (like pi)
  546.   happens to be used, the long precision should not propagate throughout all
  547.   the intermediate values. Otherwise, the long result would look precise,
  548.   but its accuracy is only that of a short float; furthermore much
  549.   computation time would be lost by calculating with long floats when only
  550.   short floats would be needed.
  551.  
  552. When rational numbers are to be converted to floats (due to FLOAT, COERCE,
  553. SQRT or a transcendental function), the result type is given by the variable
  554. *DEFAULT-FLOAT-FORMAT*.
  555.  
  556. 12.4.
  557. -----
  558.  
  559. (LCM), called without arguments, returns 1, which is the neutral element of
  560. composition with LCM.
  561.  
  562. (! n) returns the factorial of n, n a nonnegative integer.
  563.  
  564. (EXQUO x y) returns the quotient x/y of two integers x,y, and checks that it
  565. is an integer. (This is more efficient than /.)
  566.  
  567. 12.5.1.
  568. -------
  569.  
  570. (EXPT base exponent) is not very precise if exponent has large absolute
  571. value.
  572.  
  573. (LOG number base) signals an error if base = 1.
  574.  
  575. 12.5.2.
  576. -------
  577.  
  578. The value of PI is a long float with the precision given by
  579. (LONG-FLOAT-DIGITS). When this precision is changed, the value of PI is
  580. automatically recomputed. Therefore PI is a variable, not a constant.
  581.  
  582. 12.6.
  583. -----
  584.  
  585. FLOAT-RADIX always returns 2.
  586.  
  587. (FLOAT-DIGITS number digits) coerces `number' (a real number) to a floating
  588. point number with at least `digits' mantissa digits. The following holds:
  589.    (>= (FLOAT-DIGITS (FLOAT-DIGITS number digits)) digits)
  590.  
  591. 12.7.
  592. -----
  593.  
  594. BOOLE-CLR   =  0
  595. BOOLE-SET   = 15
  596. BOOLE-1     = 10
  597. BOOLE-2     = 12
  598. BOOLE-C1    =  5
  599. BOOLE-C2    =  3
  600. BOOLE-AND   =  8
  601. BOOLE-IOR   = 14
  602. BOOLE-XOR   =  6
  603. BOOLE-EQV   =  9
  604. BOOLE-NAND  =  7
  605. BOOLE-NOR   =  1
  606. BOOLE-ANDC1 =  4
  607. BOOLE-ANDC2 =  2
  608. BOOLE-ORC1  = 13
  609. BOOLE-ORC2  = 11
  610.  
  611. 12.10.
  612. ------
  613.  
  614. MOST-POSITIVE-FIXNUM = 2^24-1 = 16777215
  615. MOST-NEGATIVE-FIXNUM = -2^24 = -16777216
  616.  
  617. Together with PI, the other long float constants MOST-POSITIVE-LONG-FLOAT,
  618. LEAST-POSITIVE-LONG-FLOAT, LEAST-NEGATIVE-LONG-FLOAT,
  619. MOST-NEGATIVE-LONG-FLOAT, LONG-FLOAT-EPSILON, LONG-FLOAT-NEGATIVE-EPSILON
  620. are recomputed whenever (LONG-FLOAT-DIGITS) is changed. They are variables,
  621. not constants.
  622.  
  623.  
  624.                          CHAPTER 13: Characters
  625.                          ----------------------
  626.  
  627. See first above: 2.2.
  628.  
  629. 13.1.
  630. -----
  631.  
  632. CHAR-CODE-LIMIT = 256
  633. CHAR-FONT-LIMIT = 16
  634. CHAR-BITS-LIMIT = 16
  635.  
  636. 13.2.
  637. -----
  638.  
  639. String-chars are those characters with font = 0 and bits = 0.
  640.  
  641. The graphic characters have been described above.
  642.  
  643. The standard characters are #\Newline and those graphic characters with a
  644. code between 32 and 126 (inclusive).
  645.  
  646. The alphabetic characters are these string-chars:
  647.              ABCDEFGHIJKLMNOPQRSTUVWXYZ
  648.              abcdefghijklmnopqrstuvwxyz
  649. and the international alphabetic characters from the character set:
  650.              ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜßáíóúñѪºãõØøÀÃÕ etc.
  651.  
  652. The functions CHAR-EQUAL, CHAR-NOT-EQUAL, CHAR-LESSP, CHAR-GREATERP,
  653. CHAR-NOT-GREATERP, CHAR-NOT-LESSP ignore bits and font attributes of their
  654. arguments.
  655.  
  656. 13.4.
  657. -----
  658.  
  659. The string chars that are not graphic chars and the space character have
  660. names:
  661.   (code-char #x00) = #\Null
  662.   (code-char #x01) = #\Code1
  663.   (code-char #x02) = #\Code2
  664.   (code-char #x03) = #\Code3
  665.   (code-char #x04) = #\Code4
  666.   (code-char #x05) = #\Code5
  667.   (code-char #x06) = #\Code6
  668.   (code-char #x07) = #\Bell = #\Bel
  669.   (code-char #x08) = #\Backspace = #\Bs = #\Rubout
  670.   (code-char #x09) = #\Tab = #\Ht
  671.   (code-char #x0A) = #\Newline = #\Linefeed = #\Lf
  672.   (code-char #x0B) = #\Vt
  673.   (code-char #x0C) = #\Page = #\Ff
  674.   (code-char #x0D) = #\Return = #\Cr
  675.   (code-char #x0E) = #\So
  676.   (code-char #x0F) = #\Si
  677.   (code-char #x10) = #\Code16
  678.   (code-char #x11) = #\Code17
  679.   (code-char #x12) = #\Code18
  680.   (code-char #x13) = #\Code19
  681.   (code-char #x14) = #\Code20
  682.   (code-char #x15) = #\Code21
  683.   (code-char #x16) = #\Code22
  684.   (code-char #x17) = #\Code23
  685.   (code-char #x18) = #\Code24
  686.   (code-char #x19) = #\Code25
  687.   (code-char #x1A) = #\Code26
  688.   (code-char #x1B) = #\Escape = #\Esc
  689.   (code-char #x1C) = #\Code28
  690.   (code-char #x1D) = #\Code29
  691.   (code-char #x1E) = #\Code30
  692.   (code-char #x1F) = #\Code31
  693.   (code-char #x20) = #\Space
  694.   (code-char #x9B) = #\Csi
  695.  
  696. 13.5.
  697. -----
  698.  
  699. CHAR-CONTROL-BIT = 1
  700. CHAR-META-BIT    = 2
  701. CHAR-SUPER-BIT   = 4
  702. CHAR-HYPER-BIT   = 8
  703.  
  704.  
  705.                          CHAPTER 14: Sequences
  706.                          ---------------------
  707.  
  708. 14.1.
  709. -----
  710.  
  711. The result of NREVERSE is always EQ to the argument. NREVERSE on a vector
  712. swaps pairs of elements. NREVERSE on a list swaps the first and the last
  713. element and reverses the list chaining between them.
  714.  
  715. 14.2.
  716. -----
  717.  
  718. For iteration through a sequence, a macro DOSEQ, analogous to DOLIST, may be
  719. used instead of MAP :
  720.   (doseq (var seqform [resultform]) {declaration}* {tag|statement}* )
  721.  
  722. 14.3.
  723. -----
  724.  
  725. REMOVE, REMOVE-IF, REMOVE-IF-NOT, REMOVE-DUPLICATES return their argument
  726. unchanged, if no element has to be removed.
  727.  
  728. DELETE, DELETE-IF, DELETE-IF-NOT, DELETE-DUPLICATES destructively modify
  729. their argument: If the argument is a list, the CDR parts are modified. If
  730. the argument is a vector with fill pointer, the fill pointer is lowered and
  731. the remaining elements are compacted below the new fill pointer.
  732.  
  733. 14.5.
  734. -----
  735.  
  736. SORT and STABLE-SORT have two additional keywords :START and :END :
  737.   (SORT sequence predicate &key :key :start :end)
  738.   (STABLE-SORT sequence predicate &key :key :start :end)
  739.  
  740. SORT and STABLE-SORT are identical. They implement the mergesort algorithm.
  741.  
  742.  
  743.                          CHAPTER 15: Lists
  744.                          -----------------
  745.  
  746. 15.4.
  747. -----
  748.  
  749. SUBLIS and NSUBLIS apply the :KEY argument to the nodes of the cons tree and
  750. not to the keys of the alist.
  751.  
  752.  
  753.                       CHAPTER 16: Hash Tables
  754.                       -----------------------
  755.  
  756. 16.1.
  757. -----
  758.  
  759. MAKE-HASH-TABLE has an additional keyword :INITIAL-CONTENTS :
  760.   (MAKE-HASH-TABLE &key :test :initial-contents :size :rehash-size
  761.                         :rehash-threshold)
  762. The :INITIAL-CONTENTS argument is an alist that is used to initialize the
  763. new hash table.
  764. The :REHASH-THRESHOLD argument is ignored.
  765.  
  766. For iteration through a hash table, a macro DOHASH, analogous to DOLIST, can
  767. be used instead of MAPHASH :
  768.   (dohash (key-var value-var hash-table-form [resultform])
  769.     {declaration}* {tag|statement}*
  770.   )
  771.  
  772.  
  773.                      CHAPTER 17: Arrays
  774.                      ------------------
  775.  
  776. 17.1.
  777. -----
  778.  
  779. ARRAY-RANK-LIMIT is 65536 on 16-bit processors, 4294967296 on 32-bit
  780. processors.
  781.  
  782. ARRAY-DIMENSION-LIMIT  = 2^24 = 16777216
  783. ARRAY-TOTAL-SIZE-LIMIT = 2^24 = 16777216
  784.  
  785. 17.6.
  786. -----
  787.  
  788. An array to which another array is displaced should not be shrunk (using
  789. ADJUST-ARRAY) in such a way that the other array points into void space.
  790. This is not checked at the time ADJUST-ARRAY is called!
  791.  
  792.  
  793.                        CHAPTER 18: Strings
  794.                        -------------------
  795.  
  796. 18.2.
  797. -----
  798.  
  799. String comparison is based on the function CHAR<=. Therefore diphtongs do
  800. not obey the usual national rules. Example: "o" < "oe" < "z" < "ö".
  801.  
  802.  
  803.                         CHAPTER 19: Structures
  804.                         ----------------------
  805.  
  806. 19.5.
  807. -----
  808.  
  809. The :PRINT-FUNCTION option should contain a lambda expression
  810.   (lambda (structure stream depth) (declare (ignore depth)) ...)
  811. This lambda expression names a function whose task is to output the external
  812. representation of structure onto the stream. This may be done by outputting
  813. text onto the stream using WRITE-CHAR, WRITE-STRING, WRITE, PRIN1, PRINC,
  814. PRINT, PPRINT, FORMAT and the like. The following rules must be obeyed:
  815. * The value of *PRINT-ESCAPE* must be respected.
  816. * The value of *PRINT-PRETTY* should not and cannot be respected, since the
  817.   pretty-print mechanism is not accessible from outside.
  818. * The value of *PRINT-CIRCLE* need not to be respected. This is managed by
  819.   the system. (But the print-circle mechanism handles only those objects that
  820.   are (direct or indirect) components of structure.)
  821. * The value of *PRINT-LEVEL* is respected by
  822.   WRITE, PRIN1, PRINC, PRINT, PPRINT, FORMAT ~A, FORMAT ~S, FORMAT ~W and
  823.   FORMAT ~D,~B,~O,~X,~R,~F,~E,~G,~$ with not-numerical arguments.
  824.   Therefore the print-level mechanism works automatically if only these
  825.   functions are used for outputting objects and if they are not called on
  826.   objects with nesting level > 1. (The print-level mechanism does not
  827.   recognize how many parentheses you have output. It only counts how many
  828.   times it was called recursively.)
  829. * The value of *PRINT-LENGTH* must be respected, especially if you are
  830.   outputting an arbitrary number of components.
  831. * You need not bother about the values of *PRINT-BASE*, *PRINT-RADIX*,
  832.   *PRINT-CASE*, *PRINT-GENSYM*, *PRINT-ARRAY*, *PRINT-CLOSURE*.
  833.  
  834.  
  835.                        CHAPTER 20: The Evaluator
  836.                        -------------------------
  837.  
  838. As in Scheme, the Macro (THE-ENVIRONMENT) returns the current lexical
  839. environment. This works only in interpreted code and is not compilable!
  840.  
  841. (EVAL-ENV form [env]) evaluates a form in a given lexical environment, just
  842. if the form had been part of the program text that environment came from.
  843.  
  844.  
  845.                          CHAPTER 21: Streams
  846.                          -------------------
  847.  
  848. 21.1.
  849. -----
  850.  
  851.  
  852. 21.2.
  853. -----
  854.  
  855. The macro WITH-OUTPUT-TO-PRINTER
  856.        (with-output-to-printer (var) {declaration}* {form}*)
  857. binds the variable var to an output stream that sends its output to the
  858. printer.
  859.  
  860. 21.3.
  861. -----
  862.  
  863. CLOSE ignores its :ABORT argument.
  864.  
  865.  
  866.                      CHAPTER 22: Input/Output
  867.                      ------------------------
  868.  
  869. 22.1.2.
  870. -------
  871.  
  872. A "reserved token", i.e. a token that has potential number syntax but cannot
  873. be interpreted as a number, is interpreted as symbol when being read. (CLtL1
  874. p. 341)
  875.  
  876. When a token with package markers is read, then (CLtL1 p. 343/344) no
  877. checking is done whether the package part and the symbol-name part do not
  878. have number syntax. (What's the purpose of this check?) So we consider
  879. tokens like USER:: or :1 or LISP::4711 or 21:3 as symbols.
  880.  
  881. 22.1.3.
  882. -------
  883.  
  884. The backquote read macro also works when nested. Example:
  885.  (eval ``(,#'(lambda () ',a) ,#'(lambda () ',b)))
  886.  = (eval `(list #'(lambda () ',a) #'(lambda () ',b)))
  887.  = (eval (list 'list (list 'function (list 'lambda nil (list 'quote a)))
  888.                      (list 'function (list 'lambda nil (list 'quote b)))
  889.    )     )
  890.  
  891. 22.1.4.
  892. -------
  893.  
  894. #\ allows inputting characters of arbitrary code: #\Code231 yields the
  895. character (code-char 231.).
  896.  
  897. Additional read dispatch macros:
  898. * #Y is used to read compiled functions.
  899. * #" is used to read pathnames:
  900.      #"test.lsp" is the value of (pathname "test.lsp")
  901.  
  902. 22.1.5.
  903. -------
  904.  
  905. Is it impossible to get the read macro function of a dispatch macro
  906. character like #\# using GET-MACRO-CHARACTER.
  907.  
  908. 22.1.6.
  909. -------
  910.  
  911. In absence of SYS::WRITE-FLOAT, floating point numbers are output in radix 2.
  912.  
  913. Pathnames are written according to the syntax #"namestring" if
  914. *PRINT-ESCAPE* /= NIL. If *PRINT-ESCAPE* = NIL, only the namestring is
  915. printed.
  916.  
  917. *PRINT-CASE* controls the output not only of symbols, but also of characters
  918. and some #<...> objects.
  919.  
  920. *PRINT-PRETTY* is initially = NIL.
  921.  
  922. *PRINT-ARRAY* is initially = T.
  923.  
  924. An additional variable *PRINT-CLOSURES* controls whether compiled and
  925. interpreted functions (closures) are output in detailed form. If
  926. *PRINT-CLOSURE* /= NIL, compiled closures are output in #Y syntax the reader
  927. understands. *PRINT-CLOSURE* is initially = NIL.
  928.  
  929. 22.3.1.
  930. -------
  931.  
  932. The functions WRITE and WRITE-TO-STRING have an additional keyword :CLOSURE
  933. that can be used to bind *PRINT-CLOSURE*.
  934.  
  935. 22.3.3.
  936. -------
  937.  
  938. The FORMAT option ~W is analogous to ~A and ~S, but avoids binding of
  939. *PRINT-ESCAPE*. (FORMAT stream "~W" object) is equivalent to
  940. (WRITE object :stream stream).
  941.  
  942. FORMAT ~R and FORMAT ~:R can output only integers in the range |n| < 10^66.
  943. The output is in English, according to the American conventions, and these
  944. conventions are identical to the British conventions only in the range
  945. |n| < 10^9.
  946.  
  947. FORMAT ~:@C does not output the character itself, only the instruction how
  948. to type the character.
  949.  
  950. FORMAT ~T can determine the current column of any stream.
  951.  
  952.  
  953.                     CHAPTER 23: File System Interface
  954.                     ---------------------------------
  955.  
  956. 23.1.
  957. -----
  958.  
  959. For most operations, pathnames denoting files and pathnames denoting
  960. directories can not be used interchangeably.
  961. For example, #"FOO/BAR" denotes the file BAR in the directory FOO, while
  962. #"FOO/BAR/" denotes the subdirectory BAR of the directory FOO.
  963. This is especially important for the functions DIRECTORY, DIR, CD, MAKE-DIR,
  964. DELETE-DIR.
  965.  
  966. The minimum filename syntax that may be used portably is:
  967.   "xxx"       for a file with name xxx,
  968.   "xxx.yy"    for a file with name xxx and type yy,
  969.   ".yy"       for a pathname with type yy and no name specified.
  970. Hereby xxx denote 1 to 8 characters, and yy denote 1 to 3 characters, each of
  971. which being either alphanumerical or the underscore #\_.
  972. Other properties of pathname syntax vary between operating systems.
  973.  
  974. 23.1.1.
  975. -------
  976.  
  977. Pathname components:
  978. HOST          always NIL
  979. DEVICE        NIL or a simple string
  980. DIRECTORY     (startpoint . subdirs) where
  981.                startpoint = :RELATIVE | :ABSOLUTE
  982.                subdirs = () | (subdir . subdirs)
  983.                subdir = :WILD (means "**" or "...", all subdirectories) or
  984.                subdir = :PARENT (means "/" instead of "subdir/") or
  985.                subdir = simple string, may contain wildcard characters ? and *
  986. NAME          NIL or
  987.               simple string, may contain wildcard characters ? and *
  988.               (may also be specified as :WILD)
  989. TYPE          NIL or
  990.               simple string, may contain wildcard characters ? and *
  991.               (may also be specified as :WILD)
  992. VERSION       always NIL (may also be specified as :WILD or :NEWEST)
  993.  
  994. Constraint: startpoint = :RELATIVE only if device = NIL. If the device is
  995. specified, the pathname must be absolute!
  996.  
  997. A filename from AMIGAOS is split into name and type according to the
  998. following rule:
  999.   if there is no '.' in the filename, then the name is everything, type = NIL;
  1000.   if there is a '.', then name is the part before and type the part after
  1001.      the last dot.
  1002.  
  1003. Case is ignored in the strings on comparison. No case conversions are
  1004. performed.
  1005.  
  1006. When a pathname is to be fully specified (no wildcards), that means that
  1007. no :WILD is allowed, no wildcard characters are allowed in the strings, and
  1008. NAME = NIL may not be allowed either.
  1009.  
  1010. External notation:      dev:sub1.typ/sub2.typ/name.typ
  1011. using defaults:             sub1.typ/sub2.typ/name.typ
  1012. or                                            name.typ
  1013. or                          sub1.typ/**/sub3.typ/x*.lsp
  1014. or similar.
  1015.  
  1016. Formal specification of the external notation:
  1017.   ch ::= any character except ':','/' and '*','?'
  1018.   name ::= {ch}+
  1019.   device ::= [ <empty> | ':' | name ':' ]
  1020.              ; empty = current device, relative to current directory
  1021.              ; ':'   = current device, absolute (relative to root for disks)
  1022.              ; name ':' = specified device, absolute (relative to root for disks)
  1023.   subdir ::= [ <empty> | name ]                ; empty means parent directory
  1024.   pathname ::= device { subdir '/' }* name
  1025.  
  1026. Examples:
  1027. String       Device    Directory                our pathname
  1028. ------       ------    ---------                --------------
  1029. 'c:foo'      'C',     device->foo               "c" (:ABSOLUTE "foo")
  1030. 'c:foo/'     'C',     device->foo               "c" (:ABSOLUTE "foo")
  1031. 'c:foo/bar'  'C',     device->foo->bar          "c" (:ABSOLUTE "foo" "bar")
  1032. 'c:/foo'     'C',     device->up->foo           "c" (:ABSOLUTE :PARENT "foo")
  1033. 'c:'         'C',     device                    "c" (:ABSOLUTE)
  1034. ':foo'       current, device->root->foo         NIL (:ABSOLUTE "foo")
  1035. 'foo'        current, device->foo               NIL (:RELATIVE "foo")
  1036. '/foo'       current, device->up->foo           NIL (:RELATIVE :PARENT "foo")
  1037. '//foo/bar'  current, device->up->up->foo->bar  NIL (:RELATIVE :PARENT :PARENT "foo" "bar")
  1038. ''           current, device                    NIL (:RELATIVE)
  1039.  
  1040. Appending a '/' to a path string that is non-empty and does not end with ':'
  1041. or '/' does not change its meaning. This '/' must be appended before another
  1042. non-empty component can be appended.
  1043. But appending a '/' to a path string that is empty or ends with ':' or '/'
  1044. means going up to the parent directory!
  1045. We interpret any path string that is empty or ends with ':' or '/' as
  1046. pathname of a directory (with name = NIL and type = NIL).
  1047.  
  1048. The wildcard characters: '*' matches any sequence of characters,
  1049. '?' matches any one character.
  1050.  
  1051. Due to the name/type splitting rule, there are pathnames that can't result
  1052. from PARSE-NAMESTRING. To get a pathname whose type contains a dot or whose
  1053. name contains a dot and whose type is NIL, MAKE-PATHNAME must be used.
  1054. Example: (MAKE-PATHNAME :NAME ".profile").
  1055.  
  1056. 23.1.2.
  1057. -------
  1058.  
  1059. External notation of pathnames (cf. PARSE-NAMESTRING and NAMESTRING),
  1060. of course without spaces, [,],{,}:
  1061. see above.
  1062.  
  1063. The function USER-HOMEDIR-PATHNAME is not implemented.
  1064.  
  1065. 23.2.
  1066. -----
  1067.  
  1068. The file streams returned by OPEN are buffered for regular files and
  1069. unbuffered for special files.
  1070.  
  1071. 23.3.
  1072. -----
  1073.  
  1074. FILE-AUTHOR always returns NIL.
  1075.  
  1076. 23.4.
  1077. -----
  1078.  
  1079. LOAD has two additional keywords :ECHO and :COMPILING.
  1080. (LOAD filename &key :verbose :print :echo :if-does-not-exist :compiling)
  1081. :VERBOSE T   causes LOAD to emit a short message that a file is being loaded.
  1082.              The default is *LOAD-VERBOSE*, which is initially = T.
  1083. :PRINT T     causes LOAD to print the value of each form.
  1084.              The default is *LOAD-PRINT*, which is initially = NIL.
  1085. :ECHO T      causes the input from the file to be echoed to *STANDARD-OUTPUT*
  1086.              (normally to the screen). Should there be an error in the file,
  1087.              you can see at one glance where it is.
  1088.              The default is *LOAD-ECHO*, which is initially = NIL.
  1089. :COMPILING T causes each form read to be compiled on the fly. The compiled
  1090.              code is executed at once and - in contrast to COMPILE-FILE -
  1091.              not written to a file.
  1092.  
  1093. The variable *LOAD-PATHS* contains a list of directories where program files
  1094. are searched - additionally to the specified or current directory - by LOAD,
  1095. REQUIRE, COMPILE-FILE.
  1096.  
  1097. 23.5.
  1098. -----
  1099.  
  1100. (DIRECTORY [pathname [:full]]) can run in two modes:
  1101. * If pathname contains no name or type component, a list of all matching
  1102.   directories is produced.
  1103. * Otherwise a list of all matching files is returned. If the :FULL argument
  1104.   is /= NIL, this contains additional information: for each matching file
  1105.   you get a list of at least four elements
  1106.   (file-pathname file-truename file-write-date-as-decoded-time file-length).
  1107.  
  1108. (DIR [pathname]) is like DIRECTORY, but displays the pathnames instead of
  1109. returning them. (DIR) shows the contents of the current directory.
  1110.  
  1111. (CD [pathname]) manages the current directory.
  1112. (CD pathname) sets it, (CD) returns it.
  1113.  
  1114. (DEFAULT-DIRECTORY) is equivalent to (CD), (SETF (DEFAULT-DIRECTORY) pathname)
  1115. is equivalent to (CD pathname).
  1116.  
  1117. (MAKE-DIR directory-pathname) creates a new subdirectory.
  1118.  
  1119. (DELETE-DIR directory-pathname) removes an (empty) subdirectory.
  1120.  
  1121. (EXECUTE command)  executes a given command using the operating system's shell.
  1122.  
  1123. (SHELL [command])  calls the operating system's shell.
  1124. (SHELL) calls the shell for interactive use. (SHELL command) calls the shell
  1125. only for execution of the one given command.
  1126.  
  1127.  
  1128.                         CHAPTER 24: Errors
  1129.                         ------------------
  1130.  
  1131. 24.1.
  1132. -----
  1133.  
  1134. When an error occurred, you are in a break loop. You can evaluate forms as
  1135. usual. The HELP command (or help key if there is one) lists the available
  1136. debugging commands.
  1137.  
  1138.  
  1139.                   CHAPTER 25: Miscellaneous Features
  1140.                   ----------------------------------
  1141.  
  1142. 25.1.
  1143. -----
  1144.  
  1145. The compiler can be called not only by the functions COMPILE, COMPILE-FILE
  1146. and DISASSEMBLE, also by the declaration (COMPILE).
  1147.  
  1148. (COMPILE-FILE input-file [:output-file] [:listing] [:verbose] [:warnings])
  1149. compiles a file to bytecode.
  1150.     input-file                should be a pathname/string/symbol.
  1151. The :output-file argument     should be NIL or T or a pathname/string/symbol
  1152.                               or an output-stream. The default is T.
  1153. The :listing argument         should be NIL or T or a pathname/string/symbol
  1154.                               or an output-stream. The default is NIL.
  1155. The :warnings argument        specifies whether warnings should also appear
  1156.                               on the screen.
  1157. The :verbose argument         specifies whether error messages should also
  1158.                               appear on the screen.
  1159.  
  1160. The CLtL2 special form LOAD-TIME-VALUE is implemented. (LOAD-TIME-VALUE form)
  1161. is like (QUOTE #,form) except that the former can be generated by macros.
  1162.  
  1163. 25.2.
  1164. -----
  1165.  
  1166. No on-line documentation is available for the system functions (yet).
  1167.  
  1168. 25.3.
  1169. -----
  1170.  
  1171. (TRACE fun ...) makes the functions fun, ... traced. Syntax of fun:
  1172. Either a symbol:
  1173.        symbol
  1174. or a list of a symbol and some keywords and arguments (which must come in
  1175. pairs!):
  1176.        (symbol
  1177.          [:suppress-if form]   ; no trace output as long as form is true
  1178.          [:step-if form]       ; invokes the stepper as soon as form is true
  1179.          [:pre form]           ; evaluates form before calling the function
  1180.          [:post form]          ; evaluates form after return from the function
  1181.          [:pre-break-if form]  ; goes into the break loop before calling the
  1182.                                ; function if form is true
  1183.          [:post-break-if form] ; goes into the break loop after return from
  1184.                                ; the function if form is true
  1185.          [:pre-print form]     ; prints the values of form before calling the
  1186.                                ; function
  1187.          [:post-print form]    ; prints the values of form after return from
  1188.                                ; the function
  1189.          [:print form]         ; prints the values of form both before
  1190.                                ; calling and after return from the function
  1191.        )
  1192. In all these forms you can access
  1193.   the function itself               as *TRACE-FUNCTION*,
  1194.   the arguments to the function     as *TRACE-ARGS*,
  1195.   the function/macro call as form   as *TRACE-FORM*,
  1196. and after return from the function
  1197.   the list of return values from the function call  as *TRACE-VALUES*,
  1198. and you can leave the function call with specified values by using RETURN.
  1199.  
  1200. TRACE and UNTRACE are also applicable to macros, but not to locally defined
  1201. functions and macros.
  1202.  
  1203. The function INSPECT is not implemented.
  1204.  
  1205. The function ED calls the external editor specified by the variable *EDITOR*
  1206. (see config.lsp).
  1207.  
  1208. 25.4.1.
  1209. -------
  1210.  
  1211. The variable *DEFAULT-TIME-ZONE* contains the default time zone used by
  1212. ENCODE-UNIVERSAL-TIME and DECODE-UNIVERSAL-TIME. It is initially set to -1
  1213. (which means 1 hour east of Greenwich, i.e. Mid European Time).
  1214.  
  1215. The timezone in a decoded time must not necessarily be an integer, but (as
  1216. float or rational number) it should be a multiple of 1/4.
  1217.  
  1218. INTERNAL-TIME-UNITS-PER-SECOND = 50.
  1219.  
  1220. 25.4.2.
  1221. -------
  1222.  
  1223. The functions MACHINE-TYPE, MACHINE-VERSION, MACHINE-INSTANCE and
  1224. SHORT-SITE-NAME, LONG-SITE-NAME should be defined by every user in his
  1225. site-specific CONFIG.LSP file.
  1226.  
  1227. The variable *FEATURES* initially contains the symbols
  1228.    CLISP            ; this implementation
  1229.    COMMON-LISP
  1230.    CLTL1
  1231.    INTERPRETER
  1232.    COMPILER
  1233.    ATARI            ; if hardware = Atari ST/TT and operating system = TOS
  1234.    AMIGA            ; if hardware = Amiga       and operating system = Exec/AmigaDOS
  1235.    DOS              ; if hardware = PC (clone)  and operating system = DOS
  1236.    OS/2             ; if hardware = PC (clone)  and operating system = OS/2
  1237.    PC386            ; if hardware = PC (clone) with a 386/486
  1238.    VMS              ; if hardware = VAX         and operating system = VMS
  1239.    UNIX             ; if                            operating system = Unix
  1240.                     ;                               (yes, in this case the
  1241.                     ;                               hardware is irrelevant!)
  1242.    language         ; same as the value of *LANGUAGE*
  1243.  
  1244. The constant *LANGUAGE* is a string containing the language in which the
  1245. system communicates with the user. A symbol of the same name is contained in
  1246. *FEATURES*. Possible values are (yet): ENGLISH, DEUTSCH, FRANCAIS.
  1247.  
  1248.  
  1249.                 CHAPTER 99: Platform specific Extensions
  1250.                 ----------------------------------------
  1251.  
  1252. 99.2. ARexx
  1253. -----------
  1254.  
  1255. CLISP comes with a small yet extensible and powerful ARexx interface.
  1256.  
  1257. (REXX-DO-COMMAND "return address()" :STRING T :RESULT T) tells you the
  1258. name of the CLISP ARexx port. The default extension for CLISP ARexx
  1259. scripts is "cl".
  1260.  
  1261. (REXX-DO-COMMAND command &KEY :string :result :token :io)
  1262.   -> (RC &OPTIONAL RESULT), or NIL on failure
  1263.  
  1264. (REXX-RUN-COMMAND command &KEY :string :token)
  1265.   -> T, or NIL on failure
  1266.  
  1267. (REXX-SEND-COMMAND command &KEY :string :result :token :io :async)
  1268.   -> arexx-msg-handle, or NIL on failure
  1269.  
  1270. (REXX-WAIT-SENT-COMMAND arexx-msg-handle)
  1271.   -> (RC &OPTIONAL RESULT), or NIL on failure
  1272.  
  1273. (REXX-LOOP)
  1274.   -> no return
  1275.  
  1276. Command may be a string denoting a command with optional arguments or a
  1277. vector of strings thus denoting an ARexx function call. The first
  1278. element in the vector is the function name, the others are the up to 15
  1279. arguments.
  1280.  
  1281. ARexx server mode: Like Ispell, Csh and SKsh, you can run it in server
  1282. mode by calling (REXX-LOOP). You can then only exit with the ARexx
  1283. exit-loop.cl script.
  1284.  
  1285. Restrictions: Currently CLISP is not able to wait for input from
  1286. several sources, e.g. both a console and ARexx, at the same time.
  1287.  
  1288. 99.9. Other
  1289. -----------
  1290.  
  1291. To have *DEBUG-IO* and *ERROR-OUTPUT* point to separate console windows
  1292. (thus keeping your standard console window clean from error messages)
  1293. you can use
  1294.   (SETQ *ERROR-OUTPUT*
  1295.     (SETQ *DEBUG-IO*
  1296.       (OPEN "CON:0/0/500/300/CLISP-Debugger/AUTO/CLOSE" :DIRECTION :IO)
  1297.   ) )
  1298. at startup.
  1299.  
  1300.  
  1301. Authors:
  1302. --------
  1303.  
  1304.         Bruno Haible                    Michael Stoll
  1305.         Augartenstraße 40               Gallierweg 39
  1306.     D - W 7500 Karlsruhe 1          D - W 5300 Bonn 1
  1307.         Germany                         Germany
  1308.  
  1309. Email:  haible@ma2s2.mathematik.uni-karlsruhe.de
  1310.